Abstract:
1) The Linux shell uses let, [], (()) Three operators to manipulate shell variables for simple basic operations;
2) The Linux shell uses expr and BC two programs to achieve advanced operations;
1, basic operation of Linux
Description of UseBash has built-in support for integer arithmetic, but it does not support floating-point operations, and the BC command can be very handy for floating-point operations, and of course integer arithmetic is no longer spoken. The
BC is the abbreviation for binary calculator. The arguments to the bc* function are the operands plus an optional [int scale], such as String Bcadd (String $left _operand, String $right _operand[, int $scale]), if scale is not provided , the default
Shell floating point arithmetic tool BCBC supports floating-point numbers, which is an advanced tool for mathematical operations.[[Email protected] Desktop]# BCBC 1.06Copyright 1991-1994, 1997, 1998, Free Software Foundation, Inc.This is the free
"Purpose description"
Bash has built-in support for integer arithmetic, but does not support floating-point operations, and the BC Command makes it easy to do floating-point operations, and of course integer operations are no longer spoken. The man
The percentage of CPU, memory usage of the process seen through the top command is a floating-point number, and I need to process it while writing the script, so I learned a few things and summarized as follows.
In fact, the Shell (here is bash)
The shell floating-point calculation tool bc supports floating-point numbers and is an advanced tool for mathematical operations. [Root @ localhost desktop] # bcbc 1.06 Copyright 1991-1994,199 7, 1998,200 0 Free Software Foundation, Inc. this is
Let's talk about php floating point exact calculation, php floating point number
Bc is short for Binary Calculator. Bc * function parameters are all operands plus an optional [int scale], such as string bcadd (string $ left_operand, string $
The BC Calculator is a calculator that comes with Linux and is easy to use.OPTIONS-H,--helpPrint the usage and exit.-I.,--interactiveForce interactive mode.-L,--mathlib (commonly used, this entry will have some common mathematical functions can be
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.